package cn.com.jslh.boarpro.util;

import com.blankj.utilcode.util.SPUtils;

import java.util.ArrayList;
import java.util.List;

import cn.com.jslh.boarpro.base.BaseApplication;
import cn.com.jslh.boarpro.main.view.fragment.AddBreedingRecordFragment;
import cn.com.jslh.boarpro.main.view.fragment.AddDeliveryRecordFragment;
import cn.com.jslh.boarpro.main.view.fragment.AddDuanNaiRecordFragment;
import cn.com.jslh.boarpro.main.view.fragment.AddTemplateFragment;
import cn.com.jslh.boarpro.main.view.fragment.BreedingRecordFragment;
import cn.com.jslh.boarpro.main.view.fragment.DeliveryRecordFragment;
import cn.com.jslh.boarpro.main.view.fragment.DuanNaiRecordFragment;
import cn.com.jslh.boarpro.main.view.fragment.RecordTemplateFragment;
import cn.com.jslh.boarpro.main.view.fragment.SearchFragment;

/**
 * 作者：周洲 on 2017/8/2 09:23
 * <p>
 * 邮箱：double0zhou@126.com
 */

public class ModuleUtil {
    public static List<ModuleUtil> initModules(){
        List<ModuleUtil> modules = new ArrayList<>();
        List<Page> pages0 = new ArrayList<>();
        pages0.add(new Page("记录", BreedingRecordFragment.class));
        pages0.add(new Page("新增", AddBreedingRecordFragment.class));
        pages0.add(new Page("查询", SearchFragment.class));
        modules.add(new ModuleUtil("母猪管理","PeiZhong","配种记录",pages0));

        List<Page> pages1 = new ArrayList<>();
        pages1.add(new Page("记录", DeliveryRecordFragment.class));
        pages1.add(new Page("新增", AddDeliveryRecordFragment.class));
        pages1.add(new Page("查询", SearchFragment.class));
        modules.add(new ModuleUtil("母猪管理","FenMian","分娩记录",pages1));

        List<Page> pages2 = new ArrayList<>();
        pages2.add(new Page("记录", DuanNaiRecordFragment.class));
        pages2.add(new Page("新增", AddDuanNaiRecordFragment.class));
        pages2.add(new Page("查询", SearchFragment.class));
        modules.add(new ModuleUtil("母猪管理","DuanNai","断奶记录",pages2));

        List<Page> pages3 = new ArrayList<>();
        pages3.add(new Page("查询", SearchFragment.class));
        modules.add(new ModuleUtil("种猪管理","ZPigFlk","种猪档案",pages3));

        List<Page> pages4 = new ArrayList<>();
        pages4.add(new Page("记录", RecordTemplateFragment.class));
        pages4.add(new Page("新增", AddTemplateFragment.class));
        pages4.add(new Page("查询", SearchFragment.class));
        modules.add(new ModuleUtil("种猪管理","ZhongZhuSiTao","种猪死淘记录",pages4));

        List<Page> pages5 = new ArrayList<>();
        pages5.add(new Page("记录", RecordTemplateFragment.class));
        pages5.add(new Page("新增", AddTemplateFragment.class));
        pages5.add(new Page("查询", SearchFragment.class));
        modules.add(new ModuleUtil("种猪管理","ZhongZhuSale","种猪销售记录",pages5));

        List<Page> pages6 = new ArrayList<>();
        pages6.add(new Page("记录", RecordTemplateFragment.class));
        pages6.add(new Page("新增", AddTemplateFragment.class));
        pages6.add(new Page("查询", SearchFragment.class));
        modules.add(new ModuleUtil("种猪管理","FanQingLiuChan","返情流产记录",pages6));

        List<Page> pages7 = new ArrayList<>();
        pages7.add(new Page("记录", RecordTemplateFragment.class));
        pages7.add(new Page("新增", AddTemplateFragment.class));
        pages7.add(new Page("查询", SearchFragment.class));
        modules.add(new ModuleUtil("种猪管理", "ZhongZhuMove","种猪调动记录",pages6));

        List<Page> pages8 = new ArrayList<>();
        pages8.add(new Page("记录", RecordTemplateFragment.class));
        pages8.add(new Page("新增", AddTemplateFragment.class));
        pages8.add(new Page("查询", SearchFragment.class));
        modules.add(new ModuleUtil("母猪管理", "PeiZhong","配种记录（*）",pages8));


        List<Page> pages9 = new ArrayList<>();
        pages9.add(new Page("记录", RecordTemplateFragment.class));
        pages9.add(new Page("新增", AddTemplateFragment.class));
        pages9.add(new Page("查询", SearchFragment.class));
        modules.add(new ModuleUtil("母猪管理", "DartMeasure","背膘测定",pages9));



        return modules;
    }

    public ModuleUtil(String moduleName,String searchType, String menuName,List<Page> pages) {
        this.searchType = searchType;
        this.moduleName = moduleName;
        this.pages = pages;
        this.menuName = menuName;
    }

    private String menuName;

    private String moduleName;

    private List<Page> pages;

    private String searchType;

    public String getModuleName() {
        return moduleName;
    }

    public void setModuleName(String moduleName) {
        this.moduleName = moduleName;
    }

    public List<Page> getPages() {
        return pages;
    }

    public void setPages(List<Page> pages) {
        this.pages = pages;
    }

    public String getMenuName() {
        return menuName;
    }

    public void setMenuName(String menuName) {
        this.menuName = menuName;
    }

    public String getSearchType() {
        return searchType;
    }

    public void setSearchType(String searchType) {
        this.searchType = searchType;
    }

    public static class Page {
        private String moduleName;
        private Class fragmentClass;

        public Page(String moduleName, Class fragmentClass) {
            this.moduleName = moduleName;
            this.fragmentClass = fragmentClass;
        }

        public String getModuleName() {
            return moduleName;
        }

        public void setModuleName(String moduleName) {
            this.moduleName = moduleName;
        }

        public Class getFragmentClass() {
            return fragmentClass;
        }

        public void setFragmentClass(Class fragmentClass) {
            this.fragmentClass = fragmentClass;
        }
    }

}
